<?php
	if(!empty($_FILES)){
		foreach ($_FILES['up']['tmp_name'] as $k => $v) {
			$a = $_FILES['up']['tmp_name'][$k];
			if(is_uploaded_file($a)){
				$type = ltrim(strrchr($_FILES['up']['name'][$k], '.'),'.');
				$fileName = time() . mt_rand(0, 9999) . '.' . $type;
				$path = './a/' . date('ymd');
				is_dir($path) || mkdir($path,0777,true);
				$fullPath = $path . '/' . $fileName;
				move_uploaded_file($a, $fullPath);
			}
		}
	}
 ?>
<!doctype html>
 <html lang="en">
 <head>
 	<meta charset="UTF-8" />
 	<title>Document</title>
 </head>
 <body>
 	<form action="" method="post"enctype="multipart/form-data">
 		<!-- 选择多个文件请按住ctrl 键 然后点击图片 进行多选 -->
 		<input type="file" name="up[]" multiple="multiple"/>
 		<input type="submit" value="上传"/>
 	</form>
 </body>
 </html>
